package com.wx.user.controller;

import com.wx.user.entity.ResultEntity;
import com.wx.user.outvo.*;
import com.wx.user.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Api(tags = "用户接口")
@RestController
@RequestMapping("/back/user")
public class UserController {

    @ApiOperation("用户注册")
    @PostMapping("/register")
    public ResultEntity Register(UserVo userVo) {
        return new ResultEntity("success", 0, null, null, null);
    }

    @ApiOperation("用户登录")
    @PostMapping("/login")
    public ResultEntity Login(UserVo userVo) {
        return new ResultEntity("success", 0, null, null, null);
    }

    @ApiOperation("搜索")
    @GetMapping("/search")
    public ResultEntity Search(String parameter) {
        List list=new ArrayList();
        list.add(new SearchOutVo());
        return null;
    }

    @ApiOperation("领取优惠券")
    @PostMapping("/fetchCoupon")
    public ResultEntity FetchCoupon(CouponVo couponVo) {
        return new ResultEntity("success", 0, null, null, null);
    }

    @ApiOperation("去使用券")
    @PostMapping("/useCoupon")
    public ResultEntity UseCoupon(CouponVo couponVo) {
        List list=new ArrayList();
        list.add(new UseCouponOutVo());
        return null;
    }

    @ApiOperation("查看优惠券")
    @GetMapping("/browseCoupon")
    public ResultEntity BrowseCoupon(BrowseCouponVo browseCouponVo) {
        List list=new ArrayList();
        list.add(new BrowseCouponOutVo());
        return null;
    }

    @ApiOperation("加购物车")
    @PostMapping("/addShopCart")
    public ResultEntity AddShopCart(ShopCartVo shopCartVo) {
        List list=new ArrayList();
        list.add(new ShopCartOutVo());
        return null;
    }

    /*@ApiOperation("结算")
    @PostMapping("/settleAccounts")
    public Result SettleAccounts(AccountsVo accountsVo) {
        return null;
    }

    @ApiOperation("确认下单")
    @PostMapping("/confirmOrder")
    public Result ConfirmOrder(AccountsVo accountsVo) {
        return null;
    }

    @ApiOperation("支付")
    @PostMapping("/payment")
    public Result Payment(AccountsVo accountsVo) {
        return new Result();
    }

    @ApiOperation("取消订单")
    @PostMapping("/cancelOrder")
    public Result CancelOrder(AccountsVo accountsVo) {
        return null;
    }*/

    @ApiOperation("确认收货")
    @PostMapping("/confirmGoods")
    public ResultEntity ConfirmGoods(ConfirmVo confirmVo) {
        return new ResultEntity("success", 0, null, null, null);
    }

    @ApiOperation("查看全部订单")
    @GetMapping("/browseOrder")
    public ResultEntity BrowseOrder(OrderVo orderVo) {
        List list=new ArrayList();
        list.add(new BrowseOrderOutVo());
        return null;
    }

    @ApiOperation("查看订单详情")
    @GetMapping("/BrowseOrderDetail")
    public ResultEntity BrowseOrderDetail(MerchantVo merchantVo) {
        OrderDetailOutVo orderDetailOutVo=new OrderDetailOutVo();
        return new ResultEntity("",0, orderDetailOutVo,null, null );
    }

    @ApiOperation("删除订单")
    @PostMapping("/deleteOrder")
    public ResultEntity DeleteOrder(DeleteOrderVo deleteOrderVo) {
        return new ResultEntity("success", 0, null, null, null);
    }

    @ApiOperation("查看商品分类")
    @GetMapping("/browseCategory")
    public ResultEntity BrowseCategory(CategoryVo categoryVo) {
        List list=new ArrayList();
        list.add(new ProductTypeOutVo());
        return null;
    }

    @ApiOperation("进入店铺")
    @PostMapping("/enterStore")
    public ResultEntity EnterStore(EnterShopVo enterShopVo) {
        EnterStoreOutVo enterStoreOutVo=new EnterStoreOutVo();
        return new ResultEntity("",0, enterStoreOutVo,null, null );
    }

    @ApiOperation("查看商品详情")
    @GetMapping("/browseProductDetail")
    public ResultEntity BrowseProductDetail(ProductVo productVo) {
        ProductDetailOutVo productDetailOutVo=new ProductDetailOutVo();
        return new ResultEntity("",0, productDetailOutVo,null, null );
    }

    @ApiOperation("查看商家信息")
    @GetMapping("/browseShopMessage")
    public ResultEntity BrowseShopMessage(MerchantVo merchantVo) {
        MerchantMessageOutVo merchantMessageOutVo=new MerchantMessageOutVo();
        return new ResultEntity("",0, merchantMessageOutVo,null, null );
    }

}